﻿@{
    ViewBag.Title = "公告列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="padding5" style="height:98%;">
    <table id="AnnouncementList" class="" title="电子公告"
        fitcolumns="true" singleselect="true" pagination="true" fit="true">
        <thead>
            <tr>
                <th field="ID" width="40" sortable="true">编号</th>
                <th field="Title" width="140" sortable="true">标题</th>
                <th field="Content" width="240" sortable="true">内容</th>
                <th field="BeginTime" formatter="DateFormate" width="100" sortable="true">开始时间</th>
            </tr>
        </thead>
    </table>
</div>

<script type="text/javascript">
    var DateFormate = function (value, row, index) {
        if (value) {
            return value.DateStringConvert('yyyy-MM-dd');
        }
    };

    $(function () {
        $('#AnnouncementList').datagrid({
            url: '/PlanManagement/GetAnnouncementListNoOver',
            pageList: [10, 20],
            pageSize: 20,
            pageNumber: 1,
            onLoadSuccess: function (data) {
                $('.datagrid-btable').find('td').each(function () {
                    $(this).attr('title', $(this).text());
                });
            },
            //双击进行编辑
            onDblClickRow: function (rowIndex, rowData) {
                openDialog('/PlanManagement/AnnouncementDetail?ID=' + rowData.ID + '&canEdit=false', 800, 550);
            }

        });

        var p2 = $('#AnnouncementList').datagrid('getPager');
        $(p2).pagination({
            beforePageText: '第',
            afterPageText: '页&nbsp;共&nbsp;{pages}&nbsp;页',
            displayMsg: '当前显示{from} - {to}&nbsp;条记录&nbsp;共&nbsp;{total}&nbsp;条记录'

        });
    });

</script>
